// pages/score/score.js
var score = require("../../utils/score");
Page({
  getContent:function(e){
    this.setData({
      content:e.detail.value
    });
  },
  goSearch(){
		var content = this.data.content;
		var that = this
		var database = wx.cloud.database()
		database.collection("finalScore").where({
			username:content
		}).get().then((res)=>{
			if(res.data.length>0){
				that.setData({
					result:res.data
				})
			}
		})
	},
	
  tapback:function(e){

    this.setData({
      index:e.currentTarget.id,
      flag:true
    });
  },
    /**
     * 页面的初始数据
     */
    data: {
      content:null,
      scores:score.list,
      result:[],
      index:0,
      flag:false,
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        
    },
})